#!  python
# -*- coding: UTF-8 -*-
'''
@Author ：Star
@Date ：2022/9/6 15:03 
'''
from selenium import webdriver
from time import sleep

from selenium.webdriver.common.by import By
#反扒
op = webdriver.ChromeOptions()
op.add_experimental_option("excludeSwitches", ["enable-automation"])
#op.add_argument('--start-maximized')#窗口最大化
op.add_argument("--headless") #禁用窗口
op.add_argument("--disable-gpu") #禁用GPU

driver = webdriver.Chrome(options=op)

driver.get('https://www.baidu.com')
sleep(2)
driver.find_element_by_id('kw').send_keys('自动化测试')
sleep(3)
driver.find_element(By.ID,'su').click()
sleep(3)
driver.quit()
